<html><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta content="text/javascript" http-equiv="content-script-type">
<title>tango.io.digest.Sha256</title>

<link rel="stylesheet" type="text/css" href="css/style.css">
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="css/ie56hack.css"><![endif]-->
<script language="JavaScript" src="js/util.js" type="text/javascript"></script>
<script language="JavaScript" src="js/tree.js" type="text/javascript"></script>
<script language="JavaScript" src="js/explorer.js" type="text/javascript"></script>
<script>
function anchorFromTitle(title, path, ext) {
  var url = path + title + "." + ext;
  document.write("<a href='" + url + "'>" + title + "</a>");
  }
</script>
</head><body>
<div id="tabarea"></div><div id="explorerclient"></div>
<div id="content"><script>explorer.initialize("tango.io.digest.Sha256");</script>
        <table class="content">
                <tr><td id="docbody"><h1><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461">tango.io.digest.Sha256</a></h1>
                
<b>License:</b><br>
BSD style: see doc/license.txt for details<br><br>
<b>Version:</b><br>
Initial release: Feb 2006<br><br>
<b>author:</b><br>Regan Heath, Oskar Linde<br><br>        This module implements the SHA-256 Algorithm described by Secure
        Hash Standard, FIPS PUB 180-2<br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>class <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L28">Sha256</a></span>
<script>explorer.outline.addDecl('Sha256');</script> : MerkleDamgard; [final]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br>
<dl>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li><span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L39">this</a></span>
<script>explorer.outline.addDecl('this');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Construct an Sha256</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L50">reset</a></span>
<script>explorer.outline.addDecl('reset');</script>(); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Initialize the cipher</font><br><br>
<b>Remarks:</b><br>Returns the cipher state to it's initial value<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L66">createDigest</a></span>
<script>explorer.outline.addDecl('createDigest');</script>(ubyte[] <span class="funcparam">buf</span>); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Obtain the digest</font><br><br>
<b>Remarks:</b><br>Returns a digest of the current cipher state, this may be the
                final digest, or a digest of the state between calls to update&#40;&#41;<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L80">digestSize</a></span>
<script>explorer.outline.addDecl('digestSize');</script>();</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">The digest size of Sha-256 is 32 bytes</font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L95">blockSize</a></span>
<script>explorer.outline.addDecl('blockSize');</script>(); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Cipher block size</font><br><br>
<b>Returns:</b><br>
the block size<br><br>
<b>Remarks:</b><br>Specifies the size &#40;in bytes&#41; of the block of data to pass to
                each call to transform&#40;&#41;. For SHA256 the blockSize is 64.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L111">addSize</a></span>
<script>explorer.outline.addDecl('addSize');</script>(); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Length padding size</font><br><br>
<b>Returns:</b><br>
the length padding size<br><br>
<b>Remarks:</b><br>Specifies the size &#40;in bytes&#41; of the padding which uses the
                length of the data which has been ciphered, this padding is
                carried out by the padLength method. For SHA256 the addSize is 8.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L127">padMessage</a></span>
<script>explorer.outline.addDecl('padMessage');</script>(ubyte[] <span class="funcparam">data</span>); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Pads the cipher data</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">data</span></td><td>a slice of the cipher buffer to fill with padding</td></tr></table><br>
<b>Remarks:</b><br>Fills the passed buffer slice with the appropriate padding for
                the final call to transform&#40;&#41;. This padding will fill the cipher
                buffer up to blockSize&#40;&#41;-addSize&#40;&#41;.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L148">padLength</a></span>
<script>explorer.outline.addDecl('padLength');</script>(ubyte[] <span class="funcparam">data</span>, ulong <span class="funcparam">length</span>); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs the length padding</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">data</span></td><td>the slice of the cipher buffer to fill with padding</td></tr>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">length</span></td><td>the length of the data which has been ciphered</td></tr></table><br>
<b>Remarks:</b><br>Fills the passed buffer slice with addSize&#40;&#41; bytes of padding
                based on the length in bytes of the input data which has been
                ciphered.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>void <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L170">transform</a></span>
<script>explorer.outline.addDecl('transform');</script>(ubyte[] <span class="funcparam">input</span>); [protected, override]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black">Performs the cipher on a block of data</font><br><br>
<b>Params:</b><br>
<table>
<tr><td nowrap valign="top" style="padding-right: 8px"><span class="funcparam">data</span></td><td>the block of data to cipher</td></tr></table><br>
<b>Remarks:</b><br>The actual cipher algorithm is carried out by this method on
                the passed block of data. This method is called for every
                blockSize&#40;&#41; bytes of input data and once more with the remaining
                data padded to blockSize&#40;&#41;.<br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L217">Ch</a></span>
<script>explorer.outline.addDecl('Ch');</script>(uint <span class="funcparam">x</span>, uint <span class="funcparam">y</span>, uint <span class="funcparam">z</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L226">Maj</a></span>
<script>explorer.outline.addDecl('Maj');</script>(uint <span class="funcparam">x</span>, uint <span class="funcparam">y</span>, uint <span class="funcparam">z</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L235">sum0</a></span>
<script>explorer.outline.addDecl('sum0');</script>(uint <span class="funcparam">x</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L244">sum1</a></span>
<script>explorer.outline.addDecl('sum1');</script>(uint <span class="funcparam">x</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L253">mix0</a></span>
<script>explorer.outline.addDecl('mix0');</script>(uint <span class="funcparam">x</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L262">mix1</a></span>
<script>explorer.outline.addDecl('mix1');</script>(uint <span class="funcparam">x</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L271">rotateRight</a></span>
<script>explorer.outline.addDecl('rotateRight');</script>(uint <span class="funcparam">x</span>, uint <span class="funcparam">n</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L280">shiftRight</a></span>
<script>explorer.outline.addDecl('shiftRight');</script>(uint <span class="funcparam">x</span>, uint <span class="funcparam">n</span>); [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd></dl></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint[] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L291">K</a></span>
<script>explorer.outline.addDecl('K');</script>; [private, static]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd>
<script>explorer.outline.writeEnabled = true;</script>
<dt><span class="decl"><li>uint[8] <span class="currsymbol"><a href="http://www.dsource.org/projects/tango/browser/trunk/tango/io/digest/Sha256.d?rev=3461#L307">initial</a></span>
<script>explorer.outline.addDecl('initial');</script>; [private, static, const]</li></span></dt>
<script>explorer.outline.writeEnabled = false;</script>
<dd>
<font color="black"></font><br><br></dd></dl></td></tr>
                <tr><td id="docfooter">
                        Copyright (c) 2006 Tango. All rights reserved :: page rendered by CandyDoc. Generated by <a href="http://code.google.com/p/dil">dil</a> on Sun Jun  8 17:12:55 2008.
                </td></tr>
        </table>
</div>
<script></script>
</body></html>